package cn.elwy.rcp.ui.explorer.editor;

import cn.elwy.rcp.core.model.ui.Condition;
import cn.elwy.rcp.core.model.ui.InputModel;
import cn.elwy.rcp.ui.explorer.core.AppContext;
import cn.elwy.rcp.ui.explorer.core.service.BuilderModuleChoiceService;
import cn.elwy.rcp.ui.explorer.core.vo.ProjectConfig;

public class ModuleChoiceModel extends InputModel {

	private BuilderModuleChoiceService service = AppContext.getService(BuilderModuleChoiceService.ID,
			BuilderModuleChoiceService.class);

	public ModuleChoiceModel(ProjectConfig projectConfig) {
		super();
		setCondition(new Condition(projectConfig));
	}

	@Override
	protected Object query() {
		ProjectConfig projectConfig = getCondition().getData();
		return service.getBuilderModules(projectConfig, monitor);
	}

}
